﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ajayumi.develop.win32.Transport.AppUpgrade.Provider
{
    /// <summary>
    /// NormalUpdateProvider.cs 普通模式的应用程序更新
    /// Author   : 黄乙冬
    /// Date     : 2012-02-24
    /// </summary>
    internal class NormalProvider : AppPackageProvider
    {
        public NormalProvider(string updateFileDir)
            : base(updateFileDir)
        { }



        public override bool Update()
        {
            throw new NotImplementedException();
        }

        public override bool Restore()
        {
            throw new NotImplementedException();
        }

        protected override void CopyTo(IEnumerable<string> files, AppFileAction action)
        {
            //int index = 0;
            //int length = files.Count();

            //foreach (string item in files)
            //{
            //    string path = string.Empty;
            //    switch (action)
            //    {
            //        case AppFileAction.RestoreFile:
            //            path = item.Replace(this.BackupDir, this.AppDirectory);
            //            break;
            //        case AppFileAction.BackupFile:
            //            path = item.Replace(this.AppDirectory, this.BackupDir);
            //            break;
            //        case AppFileAction.UpdateFile:
            //            path = item.Replace(this.UpgradeDir, this.AppDirectory);
            //            break;
            //    }

            //    FileHelper.CreateDir(path);
            //    File.Copy(item, path, true);

            //    int progressPercentage = Convert.ToInt32(Convert.ToSingle(++index) / Convert.ToSingle(length) * 100f);
            //    this.OnUpgradeProgressChanged(new UpgradeProgressChangedEventArgs(action, progressPercentage, this));
            //}
        }
    }
}
